package com.zty.xiaomiadmin.server.Dao;

import com.zty.xiaomiadmin.server.Vo.User.UserData;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.mapping.StatementType;

import java.util.List;

public interface User {

    @Select("select name,email,pwd,tel,status,date from userinfo where #{i} = #{i}")
    @Options(flushCache= Options.FlushCachePolicy.TRUE)
    List<UserData> getUsers(int i);


    @Select("select count(*) from userinfo")
    int getUserCount();

    @Update("update userinfo set status = #{status},email = #{email} where name = #{name}")
    void editUser(UserData userData);

    @Delete("delete from userinfo where name = #{name}")
    void delUser(String name);
}
